package cn.wyz.basic.util;

import lombok.Data;

@Data
public class AjaxResult {
    private boolean success = true;
    private String message = "操作成功!!!";
    private Object resultObj;//返回操作的额外参数

    public static AjaxResult make(){
        return new AjaxResult();
    }

    //高端写法,方便链式编程
    public AjaxResult setSuccess(boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
